<!doctype html>
<html lang="en">
 <head>

  <meta charset="UTF-8">  
  <title>家具信息</title>
 </head>
 <body>
 
 <?php
  require_once('../inc_admin.php');
    connect();
  //编写sql语句
   $sql = 'select * from jiaju a1 left join category a2 on a1.wfx_cid=a2.wfx_cid';
  //echo $sql.'<br/>';  
  $result = fetch_array($sql); 
   
 ?>
 <center><h3>家具列表</h3></center>
 <table align="center" width="80%" border=1>
 <tr>
   <th>图片</th>
   <th>名称</th> 
   <th>产地</th> 
   <th>所属类别</th>
   <th>添加时间</th>
   <th>操作</th>       
 </tr>

 <?php
  foreach ($result as $row) {
	 echo '<tr>';
	 echo '<td align="center"><img src='.UserPhotoPath.$row['wfx_jiajulink'].' width=60 height=80 alt="无头像"></td>';
   echo '<td><a href="detail.php?id='.$row['wfx_id'].' ">'.$row['wfx_name'].'</a> </td>';
   echo '<td>'.$row['wfx_brand'].'</td>';
   echo '<td>'.$row['wfx_cname'].'</td>';
   echo '<td>'.$row['wfx_adddate'].'</td>';

	 echo '<td><a href="videoForm.html?id='.$row['wfx_id'].' ">添加</a> | 
   <a href="videoEditForm.php?id='.$row['wfx_id'].' ">修改</a> | 
	 <a href="del.php?id='.$row['wfx_id'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a></td>';
	 echo '</tr>';  
  }
  echo '</table>';  
  $totalrows = count($result);
  echo "<table align='center'><tr><td>共有{$totalrows}条记录</td></tr></table>";   
 ?>
 
 </body>
</html>